<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
  <title>修改拍卖</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f8f9fa;
      padding: 20px;
    }
    h1 {
      color: #343a40;
    }
    form {
      background-color: white;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
      max-width: 600px;
      margin: auto;
    }
    table {
      width: 100%;
      border-collapse: collapse;
    }
    td {
      padding: 10px;
      vertical-align: middle;
    }
    input[type="text"], input[type="number"], input[type="datetime-local"], textarea {
      width: 100%;
      padding: 8px;
      margin-top: 4px;
      border: 1px solid #ccc;
      border-radius: 4px;
    }
    input[type="submit"] {
      background-color: #007bff;
      color: white;
      padding: 10px 20px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
    }
    input[type="submit"]:hover {
      background-color: #0056b3;
    }
    a {
      display: inline-block;
      margin-top: 10px;
      color: #007bff;
      text-decoration: none;
    }
    a:hover {
      text-decoration: underline;
    }
    h1{
      text-align: center;
    }
    .item{
      text-align: center;
    }
  </style>
</head>
<body>
<h1>修改拍卖信息</h1>
<form action="AuctionServlet" method="post">
  <input type="hidden" name="opr" value="update">
  <input type="hidden" name="auctionId" value="${auction.auctionId}">

  <table>
    <tr>
      <td>拍卖名称:</td>
      <td><input type="text" name="auctionName" value="${auction.auctionName}" required></td>
    </tr>
    <tr>
      <td>起拍价:</td>
      <td><input type="number" step="0.01" name="auctionStartPrice"
                 value="${auction.auctionStartPrice}" required></td>
    </tr>
    <tr>
      <td>底价:</td>
      <td><input type="number" step="0.01" name="auctionUpset"
                 value="${auction.auctionUpset}" required></td>
    </tr>
    <tr>
      <td>开始时间:</td>
      <td><input type="datetime-local" name="auctionStartTime"
                 value="<fmt:formatDate value="${auction.auctionStartTime}" pattern="yyyy-MM-dd'T'HH:mm"/>" required></td>
    </tr>
    <tr>
      <td>结束时间:</td>
      <td><input type="datetime-local" name="auctionEndTime"
                 value="<fmt:formatDate value="${auction.auctionEndTime}" pattern="yyyy-MM-dd'T'HH:mm"/>" required></td>
    </tr>
    <tr>
      <td>图片URL:</td>
      <td><input type="text" name="auctionPic" value="${auction.auctionPic}"></td>
    </tr>
    <tr>
      <td>图片类型:</td>
      <td><input type="text" name="auctionPicType" value="${auction.auctionPicType}"></td>
    </tr>
    <tr>
      <td>描述:</td>
      <td><textarea name="auctionDesc" rows="4" cols="50">${auction.auctionDesc}</textarea></td>
    </tr>
    <tr class="item">
      <td colspan="2">
        <input type="submit" value="更新">
        <a href="AuctionServlet?opr=selectAll">取消</a>
      </td>
    </tr>
  </table>
</form>
</body>
</html>